package common

type ResultData struct {
	Message string `json:"message"`
	Code    int    `json:"code"`
}

const (
	SuccessCode = 200
	ServerErr   = 500
)

// SuccessResult 正确返回
func SuccessResult(message string) *ResultData {
	result := new(ResultData)
	result.Message = message
	result.Code = SuccessCode
	return result
}

// ErrResult 错误返回
func ErrResult(message string) *ResultData {
	result := new(ResultData)
	result.Message = message
	result.Code = ServerErr
	return result
}
